package com.chainyoung.component_tmtrade.ui.mvp.presenter;

import com.chainyoung.common.base.CommonSubscriber;
import com.chainyoung.common.di.scope.ActivityScope;
import com.chainyoung.common.mvp.BasePresenter;
import com.chainyoung.common.utils.RxUtils;
import com.chainyoung.component_tmtrade.bean.Ad;
import com.chainyoung.component_tmtrade.ui.mvp.contract.AboutFiatCurrencyContact;
import com.chainyoung.component_tmtrade.ui.mvp.contract.TradeCurrencyBuyContract;

import java.util.TreeMap;

import javax.inject.Inject;

@ActivityScope
public class AboutFiatCurrencyPresenter extends BasePresenter<AboutFiatCurrencyContact.Model, AboutFiatCurrencyContact.View> {

    @Inject
    public AboutFiatCurrencyPresenter(AboutFiatCurrencyContact.Model model, AboutFiatCurrencyContact.View rootView) {
        super(model, rootView);
    }


    public void getFiatCurrencyNotice() {
        addSubscribe(mModel.getFiatCurrencyNotice()
                .compose(RxUtils.<Ad>rxSchedulerHelper())
                .subscribeWith(new CommonSubscriber<Ad>(mView) {
                    @Override
                    public void onNext(Ad data) {
                        mView.showFiatCurrencyNotice(data);
                    }

                    @Override
                    public void onError(Throwable e) {
                        super.onError(e);
                    }
                }));
    }
}
